Rails.application.routes.draw do
  resource :wechat, only: [:show, :create]
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".



  # You can have the root of your site routed with "root"
  root 'root#index'
  get 'sign_in' => 'root#sign_in'
  get 'get_location' => 'root#get_location'
  get 'refresh_location' => 'root#refresh_location'
  get 'product_search' => 'root#product_search'
  get 'product_show' => 'root#product_show'
  post 'order_notify' => 'root#order_notify'

  # Example of regular route:
  post 'elephant_services/post_data' => 'elephant_service#post_data'
  get 'elephant_services/get_data' => 'elephant_service#get_data'
  put 'elephant_services/put_data' => 'elephant_service#put_data'
  patch 'elephant_services/patch_data' => 'elephant_service#patch_data'
  delete 'elephant_services/delete_data' => 'elephant_service#delete_data'

  post 'customer_services/post_data' => 'customer_service#post_data'
  get 'customer_services/get_data' => 'customer_service#get_data'
  put 'customer_services/put_data' => 'customer_service#put_data'
  patch 'customer_services/patch_data' => 'customer_service#patch_data'
  delete 'customer_services/delete_data' => 'customer_service#delete_data'


  resource :wechat, only: [:show, :create] do
    collection do
      get :message_box
      get :direct_message_box
    end
  end

  get 'weui/index' => 'weuis#index'
  get 'weui/dialog' => 'weuis#dialog'
  get 'weui/toast' => 'weuis#toast'
  get 'weui/actionsheet' => 'weuis#actionsheet'

  get 'order/new' => 'orders#new'
  get 'order/success' => 'orders#success'

  get 'order/index' => 'orders#index'
  get 'order/show' => 'orders#show'
  get 'order/goto_map' => 'orders#goto_map'


  get 'carousel/group_index' => 'carousels#group_index'
  get 'carousel/promotion_index' => 'carousels#promotion_index'



  # Example of named route that can be invoked with purchase_url(id: product.id)
  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

  # Example resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Example resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Example resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Example resource route with more complex sub-resources:
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', on: :collection
  #     end
  #   end

  # Example resource route with concerns:
  #   concern :toggleable do
  #     post 'toggle'
  #   end
  #   resources :posts, concerns: :toggleable
  #   resources :photos, concerns: :toggleable

  # Example resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end
end
